package com.edu.exam.enums.analysis;

/**
 * 表现趋势枚举
 */
public enum PerformanceTrend {
    IMPROVING("IMPROVING", "改善中"),
    DECLINING("DECLINING", "下降中"),
    STABLE("STABLE", "稳定"),
    FLUCTUATING("FLUCTUATING", "波动"),
    INSUFFICIENT_DATA("INSUFFICIENT_DATA", "数据不足");

    private final String code;
    private final String description;

    PerformanceTrend(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static PerformanceTrend fromCode(String code) {
        for (PerformanceTrend trend : values()) {
            if (trend.getCode().equals(code)) {
                return trend;
            }
        }
        return INSUFFICIENT_DATA;
    }
}